package Vistas;
import java.util.Vector;
import javax.swing.JLabel;
import javax.swing.JScrollPane;

import javax.swing.JTable;

import javax.swing.WindowConstants;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.SwingUtilities;

import Modelos.Ingrediente;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class FrmCantidadIngrediente extends javax.swing.JFrame {
	private JTable jTable1;
	private DefaultTableModel jTable1Model;
	private JScrollPane jScrollPane1;
	private JLabel jLabel2;
	private JLabel jLabel1;

	/**
	* Auto-generated main method to display this JFrame
	*/
	
	
	public void AgregarCantidad(Vector<Ingrediente> arr){
		
		for(int i=0;i<arr.size();i++){
			Vector fila= new Vector();
			fila.add(arr.elementAt(i).getNombre());
			fila.add(arr.elementAt(i).getStock());
			jTable1Model.addRow(fila);
		}
	}
	
	public FrmCantidadIngrediente() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(null);
			{
				jLabel1 = new JLabel();
				getContentPane().add(jLabel1);
				jLabel1.setText("Nombre");
				jLabel1.setBounds(33, 36, 128, 14);
			}
			{
				jLabel2 = new JLabel();
				getContentPane().add(jLabel2);
				jLabel2.setText("Uso");
				jLabel2.setBounds(348, 36, 128, 14);
			}
			{
				jScrollPane1 = new JScrollPane();
				getContentPane().add(jScrollPane1);
				jScrollPane1.setBounds(38, 62, 493, 335);
				{
					jTable1Model = new DefaultTableModel(0,2); 
					/*new DefaultTableModel(
							new String[][] { { "One", "Two" }, { "Three", "Four" } },
							new String[] { "Column 1", "Column 2" });*/
							jTable1 = new JTable();
							jScrollPane1.setViewportView(jTable1);
							jTable1.setModel(jTable1Model);
							jTable1.setBounds(529, 22, 121, 107);
							jTable1.setPreferredSize(new java.awt.Dimension(490, 288));
				}
			}
			pack();
			this.setSize(743, 470);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

}
